package org.enwey.icarenew.Component;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import org.enwey.icarenew.Model.NewStyle;
import org.enwey.icarenew.R;


/**
 * Created by enwey on 2014/11/20.
 */
public class NewStyleItem extends LinearLayout {
    private ImageView mStyleImg;
    private TextView mStyleTitle;
    public NewStyleItem(Context context) {
        super(context);
        initView();
    }
    public NewStyleItem(Context context, AttributeSet attrs) {
        super(context, attrs);
        initView();
    }

    private void initView() {
        LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        View view = inflater.inflate(R.layout.style_menu_item, this);
        findView(view);
    }

    private void findView(View view) {
        mStyleImg = (ImageView) view.findViewById(R.id.style_menu_item_img);
        mStyleTitle = (TextView) view.findViewById(R.id.style_menu_item_title);
    }

    public void setStyleData(NewStyle newStyle) {
        mStyleTitle.setText(newStyle.name+ "");
    }
}
